# -*- coding: utf-8 -*-
# @Time : 2022/4/9 21:50
# @Author : Liuqing
# @File : 25_元素顺序打乱.py
# @Software : PyCharm
from copy import deepcopy
from random import randint


def shuffle(lst):
    temp_list = deepcopy(lst)
    length = len(temp_list)
    while length:
        length -= 1
        i = randint(0, length)
        temp_list[length], temp_list[i] = temp_list[i], temp_list[length]
    return temp_list


if __name__ == '__main__':
    foo = [1, 2, 3, 4, 5]
    print(shuffle(foo))
